package com.sg.controller.pbff;

import com.sg.service.biz.pbff.CycleConfService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "CycleConf", tags = {"CycleConf"})
@RestController
// @RequestMapping("/poms/cycleConf/")
public class CycleConfController {
    @Autowired
    CycleConfService cycleConfService;

    /**
     * B3-4新增时段规则
     * gen by moon at 8/10/2022, 3:46:36 AM
     */
    @PostMapping("/oms/platform/cycleConf/addCycleTimeRule")
    @ApiOperation(value = "B3-4新增时段规则", response = OkrResult.class)
    public OkrResult<BffAddCycleTimeRuleRespDto> addCycleTimeRule(@RequestBody(required = false) @Validated BffAddCycleTimeRuleReqDto reqDTO) {
        return OkrResult.success(cycleConfService.addCycleTimeRule(reqDTO));
    }

    /**
     * B3-4查询时段规则列表(边界)
     * gen by moon at 8/10/2022, 3:47:08 AM
     */
    @PostMapping("/oms/platform/cycleConf/queryCycleTimeRuleListBorder")
    @ApiOperation(value = "B3-4查询时段规则列表(边界)", response = OkrResult.class)
    public OkrResult<BffQueryCycleTimeRuleListBorderRespDto> queryCycleTimeRuleListBorder(@RequestBody(required = false) @Validated BffQueryCycleTimeRuleListBorderReqDto reqDTO) {
        return OkrResult.success(cycleConfService.queryCycleTimeRuleListBorder(reqDTO));
    }

    /**
     * B3-2查周期配置详情
     * gen by moon at 10/12/2022, 11:46:40 PM
     */
    @PostMapping("/oms/platform/cycleConf/queryCycleConfDetail")
    @ApiOperation(value = "B3-2查周期配置详情", response = OkrResult.class)
    public OkrResult<BffQueryCycleConfDetailRespDto> queryCycleConfDetail(@RequestBody(required = false) @Validated BffQueryCycleConfDetailReqDto reqDTO) {
        return OkrResult.success(cycleConfService.queryCycleConfDetail(reqDTO));
    }

    /**
     * B3-2查周期配置列表（平台）
     * gen by moon at 8/17/2022, 8:04:01 PM
     */
    @PostMapping("/oms/platform/cycleConf/queryCycleConfList")
    @ApiOperation(value = "B3-2查周期配置列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleConfListRespDto> queryCycleConfList(@RequestBody(required = false) @Validated BffQueryCycleConfListReqDto reqDTO) {
        return OkrResult.success(cycleConfService.queryCycleConfList(reqDTO));
    }

    /**
     * B3-2修改周期配置
     * gen by moon at 8/10/2022, 3:46:56 AM
     */
    @PostMapping("/oms/platform/cycleConf/updateCycleConf")
    @ApiOperation(value = "B3-2修改周期配置", response = OkrResult.class)
    public OkrResult<BffUpdateCycleConfRespDto> updateCycleConf(@RequestBody(required = false) @Validated BffUpdateCycleConfReqDto reqDTO) {
        return OkrResult.success(cycleConfService.updateCycleConf(reqDTO));
    }

    /**
     * B3-2新增周期配置
     * gen by moon at 8/10/2022, 3:46:52 AM
     */
    @PostMapping("/oms/platform/cycleConf/addCycleConf")
    @ApiOperation(value = "B3-2新增周期配置", response = OkrResult.class)
    public OkrResult<BffAddCycleConfRespDto> addCycleConf(@RequestBody(required = false) @Validated BffAddCycleConfReqDto reqDTO) {
        return OkrResult.success(cycleConfService.addCycleConf(reqDTO));
    }

    /**
     * B3-4查时段规则详情
     * gen by moon at 8/10/2022, 3:46:49 AM
     */
    @PostMapping("/oms/platform/cycleConf/queryCycleTimeRuleDetail")
    @ApiOperation(value = "B3-4查时段规则详情", response = OkrResult.class)
    public OkrResult<BffQueryCycleTimeRuleDetailRespDto> queryCycleTimeRuleDetail(@RequestBody(required = false) @Validated BffQueryCycleTimeRuleDetailReqDto reqDTO) {
        return OkrResult.success(cycleConfService.queryCycleTimeRuleDetail(reqDTO));
    }

    /**
     * B3-4查时段规则列表（平台）
     * gen by moon at 8/10/2022, 3:46:45 AM
     */
    @PostMapping("/oms/platform/cycleConf/queryCycleTimeRuleList")
    @ApiOperation(value = "B3-4查时段规则列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryCycleTimeRuleListRespDto> queryCycleTimeRuleList(@RequestBody(required = false) @Validated BffQueryCycleTimeRuleListReqDto reqDTO) {
        return OkrResult.success(cycleConfService.queryCycleTimeRuleList(reqDTO));
    }

    /**
     * B3-4修改时段规则
     * gen by moon at 8/10/2022, 3:46:40 AM
     */
    @PostMapping("/oms/platform/cycleConf/updateCycleTimeRule")
    @ApiOperation(value = "B3-4修改时段规则", response = OkrResult.class)
    public OkrResult<BffUpdateCycleTimeRuleRespDto> updateCycleTimeRule(@RequestBody(required = false) @Validated BffUpdateCycleTimeRuleReqDto reqDTO) {
        return OkrResult.success(cycleConfService.updateCycleTimeRule(reqDTO));
    }

}

